﻿using System;
using WeixinSDK.API;

namespace WeixinDemo
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(WxTestHandler.wxSetting.AppSecret))
            {
                var root = System.IO.Path.GetPathRoot(AppDomain.CurrentDomain.BaseDirectory);
                var file = System.IO.Path.Combine(root, "0000\\weixin.txt");
                var json = System.IO.File.ReadAllText(file);
                Response.Write(json);
            }
            else
            {
                var accessToken = AccessToken.Get(WxTestHandler.wxSetting);
                Response.Write(accessToken);
            }
        }
    }
}